/*
 * @Author: kevin.w gtomkai@gmail.com
 * @Date: 2021-02-23 13:58:06
 * @LastEditors: kevin.w gtomkai@gmail.com
 * @LastEditTime: 2023-02-02 17:56:34
 * @FilePath: /商家平台/src/components/LZDescriptions/index.jsx
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import React from 'react';
import { Descriptions } from 'antd';

export const renderDescriptionsItems = (fields, title) => {
  return (
    <Descriptions title={title}>
      {fields &&
        fields.map(field => {
          return (
            <Descriptions.Item key={field.label} label={field.label} className={field.className}>
              {field.render ? field.render : field.value}
            </Descriptions.Item>
          );
        })}
    </Descriptions>
  );
};
